import React from 'react';
import { Tag } from 'antd';
import { COLOR } from 'src/utils/color';

export default function Result(props) {
  const color = getResult(props.value);
  return <Tag color={color}>{props.children}</Tag>;
}

function getResult(text) {
  switch (text) {
    case 'pass':
      return COLOR._GREEN;
    case 'review':
      return COLOR._ORANGE;
    case 'refuse':
      return COLOR._RED;
    // case 'pass_return':
    //   return COLOR._GREEN;
    default:
      break;
  }
}
